from scrapy.cmdline import execute

import sys
import os

# /Volumes/Extreme_SSD/work-folder/py-workspace/imooc/scrapyStudy/scrapy01/ArticleSpider/main.py
# 当前main.py所在文件路径
print(__file__)

# /Volumes/Extreme_SSD/work-folder/py-workspace/imooc/scrapyStudy/scrapy01/ArticleSpider
# 当前main.py所在文件夹路径
# print(os.path.dirname(__file__))
# print(os.path.dirname(os.path.abspath(__file__)))

sys.path.append(os.path.dirname(os.path.abspath(__file__)))

# 启动scrapy
# execute(['scrapy', 'crawl', 'cnblogs'])
execute(['scrapy', 'crawl', 'zhihu'])
